<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>发货单</title>
		<script src="/js/vue.js"></script>
		<script src="/js/axios.js"></script>
		<script src="/js/qs.js"></script>
		<script src="/js/jquery.min.js"></script>
		<script src="//unpkg.com/element-ui@2.4.11/lib/index.js"></script>
		<style scoped>
			/* 在此定义当前页面css */
			@import url("//unpkg.com/element-ui@2.4.11/lib/theme-chalk/index.css");
		</style>
		<style type="text/css">
			#app {
				/* border:1px #dee1eb solid; */
			}

			#max {

				margin: 0 auto;
				margin-top: 40px;
				margin-bottom: 40px;
				width: 95%;
				background-color: white;
			}

			#max1 {

				margin: 0 auto;
				margin-bottom: 40px;
				width: 95%;

			}

			.table1 {
				margin: 0 auto;
				width: 80%;
			}

			.table1 tr {
				height: 40px;

			}

			.td1 {
				width: 10%;
				font-size: 12px;
				/* border-bottom:1px solid black; */
				/* border: 1px #e5e5e5 solid; */
				/* background-color: #F9F9F9; */
			}

			.td2 {
				font-size: 12px;
				text-align: left;
				width: 40%;
			}

			.el-table__header th,
			.el-table__header tr {
				background-color: #dee1e6;
				color: black;
				font-size: 12px;
				line-height: 20px;
			}

			#appreturnleft {
				background-color: white;
				border: 1px #dee1eb solid;
			}

			#appreturnright {
				background-color: white;
				border: 1px #dee1eb solid;
			}
		</style>
	</head>
	<body style="background-color: #f4f8fb;">
		<div id="max" style="border-radius: 1%;">
			<div id="apphard" style="overflow:hidden ;border-radius: 3%;">
				<span style="font-size: 18px; margin-left:  10px; line-height: 60px;">发货单/发货明细</span>
				<el-button plain @click="updateAddress" style="float:right ;margin: 0; margin-right: 2%;
			margin-top: 1%;">编辑发货单</el-button>
			
				<el-dialog title="编辑发货单" width="55%" :visible.sync="dialogAddressVisible">
					<el-form :rules="rules" ref="Addressform" style="font-size: 12px;" :model="Addressform">
						<el-row :gutter="20">
							<el-col :span="12">
								<el-form-item label="订单:"  label-width="100px">
									${outgood.o_name}
								</el-form-item>
							</el-col>
						<el-row :gutter="20">
							<el-col :span="12">
									<el-form-item label="客户:"  label-width="100px">
										${outgood.cust_name}
									</el-form-item>
								</el-col>
							</el-row>
						</el-row>
						<el-row :gutter="20">
							<el-col :span="12">
								<!-- prop="uitemv" -->
								<el-form-item label="所有者:" label-width="100px" >
									<el-select v-model="Addressform.uid" @clear="uitemvto()" clearable filterable="" remote="" reserve-keyword
									 placeholder="请输入关键词" :remote-method="uidremoteMethod" :loading="uidloading">
										<i slot="prefix" class="el-input__icon el-icon-search"></i>
										<el-option v-for="item in uitemv" :key="item.value" :label="item.label" :value="item.value">
										</el-option>
									</el-select>
								</el-form-item>
							</el-col>
							<el-col :span="12">
							</el-col>
						</el-row>
						<hr style="border: 0.5px solid #EEEEEE;" />
						<el-row :gutter="20">
							<el-form-item label="收货人/地址:" label-width="100px">
										<span style="color: #333333;font-weight: 700;">收货人:</span>
										<hr style="border: 0.5px solid #EEEEEE;" />
										<el-row :gutter="20">
											<el-col :span="12">
												<el-form-item label="从联系人读取:" prop="custID" label-width="100px">
													<el-select @change="aa()" @clear="uosign1to()" v-model="Addressform.osign1" clearable filterable="" remote=""
													 reserve-keyword placeholder="请输入关键词" :remote-method="osignremoteMethod1" :loading="osignloading1">
														<i slot="prefix" class="el-input__icon el-icon-search"></i>
														<el-option v-for="item in uosign1" :key="item.value" :label="item.label" :value="item.value"> <i slot="prefix"
															 class="el-input__icon el-icon-search"></i>
														</el-option>
													</el-select>
												</el-form-item>
											</el-col>
										</el-row>
										<el-row :gutter="30" style="margin-top: 20px;">
											<el-col :span="12">
												<el-form-item label="或者填写姓名:" prop="custID" label-width="100px">
													<el-input v-model="Addressform.oconsignee"></el-input>
												</el-form-item>
											</el-col>
										</el-row>
										<el-row :gutter="30" style="margin-top: 20px;">
											<el-col :span="12">
												<el-form-item label="电话:" prop="custID" label-width="100px">
													<el-input v-model="Addressform.conphone"></el-input>
												</el-form-item>
											</el-col>
										</el-row>
										<span style="color: #333333;font-weight: 700;">收货地址:</span>
										<hr style="border: 0.5px solid #EEEEEE;" />
										<el-row :gutter="30" style="margin-top: 20px;">
											<el-col :span="24">
												<el-form-item label="地址:" prop="custID" label-width="100px">
													<el-input v-model="Addressform.contaddress" style="width: 80%;"></el-input>
												</el-form-item>
											</el-col>
										</el-row>
										<el-row :gutter="30" style="margin-top: 20px;">
											<el-col :span="12">
												<el-form-item label="邮编:" prop="custID" label-width="100px">
													<el-input v-model="Addressform.postcode"></el-input>
												</el-form-item>
											</el-col>
										</el-row>
							</el-form-item>
						</el-row>
					</el-form>
					<div slot="footer" class="dialog-footer">
						<el-button @click="dialogAddressVisible = false">取 消</el-button>
						<!-- dialogFormVisible = false -->
						<el-button type="primary" @click="submitFormUp('Addressform')">保存</el-button>
					</div>
				</el-dialog>
			
			</div>
			
				<hr />
				<el-form ref="repform" label-width="100px" class="demo-repform" style="width: 90%;margin-top: 20px;margin-left:4%;">
					<el-row>
						<el-col :span="10" style="margin-left:50px;">
							<el-form-item label="客户:" label-width="120px">
								<div style="border-bottom: 1px solid #DCDCDC;height: 35px;font-size: 15px;">${outgood.cust_name} </div>
							</el-form-item>
						</el-col>
					</el-row>
					<el-row>
						<el-col :span="10" style="margin-left:50px;">
							<el-form-item label="订单:" label-width="120px">
								<div style="border-bottom: 1px solid #DCDCDC;height: 35px;font-size: 15px;">${outgood.o_name}</div>
							</el-form-item>
						</el-col>
						<el-col :span="10" style="margin-left:40px;">
							<el-form-item label="发货人:" label-width="120px">
								<div style="border-bottom: 1px solid #DCDCDC;height: 35px;font-size: 15px;"> ${outgood.u_name}</div>
							</el-form-item>
						</el-col>
					</el-row>
					<el-row>
						<el-col :span="10" style="margin-left:50px;">
							<el-form-item label="发货日期:" label-width="120px">
								<div style="border-bottom: 1px solid #DCDCDC;height: 35px;font-size: 15px;">
									<span v-if="boodate">
										{{date1}}
									</span>
									<span v-if="!boodate">
										${outgood.deliverydate}
									</span>
								</div>
							</el-form-item>
						</el-col>
						<el-col :span="10" style="margin-left:40px;">
							<el-form-item label="发货单:" label-width="120px">
								<div style="border-bottom: 1px solid #DCDCDC;height: 35px;font-size: 15px;">${outgood.ogId} </div>
							</el-form-item>
						</el-col>
					</el-row>
					<el-row>
						<el-col style="margin-left:50px;">
							<el-form-item label="收货人/地址:" label-width="120px">
								<el-collapse>
									<el-collapse-item title="点击展开详细信息:" name="1">
										<el-row :gutter="10">
											<el-col :span="4">
												<div style="color: #333333;font-weight: 700; ">收货人</div>
											</el-col>
											<el-col :span="24"></el-col>
										</el-row>
										<el-row :gutter="10">
											<el-col :span="16">
												<el-form-item label="姓名:" label-width="120px">
													<div style="border-bottom: 1px solid #DCDCDC;height: 35px;font-size: 15px;">${outgood.cust_name}</div>
												</el-form-item>
											</el-col>
										</el-row>
										<el-row :gutter="10">
											<el-col :span="16">
												<el-form-item label="电话:" label-width="120px">
													<div style="border-bottom: 1px solid #DCDCDC;height: 35px;font-size: 15px;">${outgood.ogPhone}</div>
												</el-form-item>
											</el-col>
										</el-row>
										<el-row :gutter="10">
											<el-col :span="4">
												<div style="color: #333333;font-weight: 700;">地址</div>
											</el-col>
											<el-col :span="24"></el-col>
										</el-row>
										<el-row :gutter="10">
											<el-col :span="16">
												<el-form-item label="地址:" label-width="120px">
													<div style="border-bottom: 1px solid #DCDCDC;height: 35px;font-size: 15px;">${outgood.ogAddress}</div>
												</el-form-item>
										</el-row>
										<el-row :gutter="10">
											<el-col :span="16">
												<el-form-item label="邮编:" label-width="120px">
													<div style="border-bottom: 1px solid #DCDCDC;height: 35px;font-size: 15px;">${outgood.ogPostcode}</div>
												</el-form-item>
										</el-row>
									</el-collapse-item>
								</el-collapse>
							</el-form-item>
						</el-col>
					</el-row>
					<el-row>
						<el-col style="margin-left:50px;">
							<el-form-item label="明细:" label-width="120px">
							</el-form-item>
						</el-col>
						<el-col style="margin-left:50px;">
							<div style="margin: 0 auto; width:90%;">
								<template>
									<el-table :data="tableData" border style="margin: 0 auto; border-radius: 10px; " :summary-method="getSummaries"
									 show-summary>
										<el-table-column prop="p_name" label="产品名" align="center">
										</el-table-column>
										<el-table-column prop="p_name" label="型号" align="center">
										</el-table-column>
										<el-table-column prop="odCount" label="数量" align="center">
										</el-table-column>
										<el-table-column prop="p_unit" label="单位" align="center">
										</el-table-column>
										<el-table-column prop="odPrice" label="单价" align="center">
										</el-table-column>
										<el-table-column prop="odDiscount" label="折扣" align="center">
										</el-table-column>
										<el-table-column prop="odMoney" label="金额" align="center">
										</el-table-column>
										<el-table-column prop="odRemark" show-overflow-tooltip label="备注" align="center">
										</el-table-column>
									</el-table>
								</template>
							</div>
						</el-col>
					</el-row>
					<el-row>
						<div style="width: 50px; float: right; margin-right: 50px; margin-top: 30px; cursor: pointer; " v-if="'${outgood.ogType}'=='1'">
							<el-tooltip content="Bottom center" placement="bottom">
								<div slot="content">编辑物流信息</div>
								<i  @click="updatePhysical" class="el-icon-setting"></i>
							</el-tooltip>
						</div>
					</el-row>
					<el-row>
						<el-col :span="10" style="margin-left:50px;">
							<el-form-item label="发货方式:" label-width="120px">
								<div style="border-bottom: 1px solid #DCDCDC;height: 35px;font-size: 15px; ">${outgood.deliverymethod}</div>
							</el-form-item>
						</el-col>
						<el-col :span="10" style="margin-left:40px;">
							<el-form-item label="状态:" label-width="120px">
								<div style="border-bottom: 1px solid #DCDCDC;height: 35px;font-size: 15px;">
									<span style="color: red; font-weight: 600;" v-if="'${outgood.ogType}'=='0'">
										未发货
									</span>
									<span style="color: red; font-weight: 600;" v-if="'${outgood.ogType}'=='1'">
										已发货
									</span>
								</div>
							</el-form-item>
						</el-col>
					</el-row>
					<el-row>
						<el-col :span="10" style="margin-left:50px;">
							<el-form-item label="物流公司:" label-width="120px">
								<div style="border-bottom: 1px solid #DCDCDC;height: 35px;font-size: 15px;">${outgood.ogPhysical}</div>
							</el-form-item>
						</el-col>
						<el-col :span="10" style="margin-left:40px;">
							<el-form-item label="物流单号:" label-width="120px">
								<div style="border-bottom: 1px solid #DCDCDC;height: 35px;font-size: 15px;">${outgood.ogPhysicalid} </div>
							</el-form-item>
						</el-col>
					</el-row>
					<el-row>
						<el-col :span="10" style="margin-left:50px;">
							<el-form-item label="运费:" prop="carriagemoney" label-width="120px">
								<div style="border-bottom: 1px solid #DCDCDC;height: 35px;font-size: 15px;">${outgood.carriagemoney} </div>
							</el-form-item>
						</el-col>
						<el-col :span="10" style="margin-left:40px;">
							<el-form-item label="运费结算:" label-width="120px">
								<div style="border-bottom: 1px solid #DCDCDC;height: 35px;font-size: 15px;">${outgood.carriagejs} </div>
							</el-form-item>
						</el-col>
					</el-row>
					<el-row>
						<el-col :span="21" style="margin-left:50px;">
							<el-form-item label="备注:" label-width="120px">
								<div style="border-bottom: 1px solid #DCDCDC;height: 35px;font-size: 15px;">${outgood.ogRemark} </div>
							</el-form-item>
						</el-col>
					</el-row>
				</el-form>
				<div style="margin: 0 auto; margin-top: 20px; width: 145px;" v-if="'${outgood.ogType}'=='0'" >
					<el-button type="primary" @click="dialogPhysicalVisible=true" size="medium"  >发货、点此确认发货</el-button>
				</div>
				<el-dialog title="发货/物流信息" :visible.sync="dialogPhysicalVisible" width="40%">
					<hr style="border: 0.5px solid #666666;margin: -15px 0px 35px;" />
					<el-form :model="physicalform" :rules="rules" ref="physicalform" label-width="100px" class="demo-physicalform">
						<el-form-item label="物流公司:" label-width="80px">
							<el-autocomplete class="inline-input" style="width: 90%;" v-model="physicalform.ogPhysical" :fetch-suggestions="querySearch"
							 placeholder="请输入内容" @select="handleSelect">
							</el-autocomplete>
							<!-- <el-input  placeholder="" v-model="physicalform.ogPhysical"
							 style="width: 90%;"></el-input> -->
						</el-form-item>
						<el-form-item label="物流单号:"   prop="ogPhysicalid"  label-width="80px">
							<el-input placeholder="" v-model="physicalform.ogPhysicalid" style="width: 90%;"></el-input>
						</el-form-item>
						<el-form-item label="运费:" prop="carriagemoney" label-width="80px">
							<el-input placeholder="" v-model="physicalform.carriagemoney" style="width: 90%;"></el-input>
						</el-form-item>
						<el-form-item label="运费结算:" label-width="80px">
							<el-input placeholder="" v-model="physicalform.carriagejs" style="width: 90%;"></el-input>
						</el-form-item>
						<el-form-item label="备注:" label-width="80px">
							<el-input placeholder="" v-model="physicalform.ogRemark" style="width: 90%;"></el-input>
						</el-form-item>
					</el-form>
					<div slot="footer" class="dialog-footer">
						<el-button @click="rdialogFormVisible = false">取 消</el-button>
						<!-- dialogFormVisible = false -->
						<el-button type="primary" @click="addphysicalForm('physicalform')">确定</el-button>
					</div>
				</el-dialog>
				
				<el-dialog title="发货/物流信息" :visible.sync="dialogPhysicalVisible1" width="40%">
					<hr style="border: 0.5px solid #666666;margin: -15px 0px 35px;" />
					<el-form :model="physicalform1" :rules="rules" ref="physicalform1" label-width="100px" class="demo-physicalform">
						<el-form-item label="物流公司:" label-width="80px">
							<el-autocomplete style="width: 90%;" class="inline-input" v-model="physicalform1.ogPhysical" :fetch-suggestions="querySearch"
							 placeholder="请输入内容" @select="handleSelect">
							</el-autocomplete>
							<!-- <el-input  placeholder="" v-model="physicalform.ogPhysical"
							 style="width: 90%;"></el-input> -->
						</el-form-item>
						<el-form-item label="物流单号:" required  prop="ogPhysicalid" label-width="80px">
							<el-input placeholder="" v-model="physicalform1.ogPhysicalid" style="width: 90%;"></el-input>
						</el-form-item>
						<el-form-item label="运费:" label-width="80px">
							<el-input placeholder="" v-model="physicalform1.carriagemoney" style="width: 90%;"></el-input>
						</el-form-item>
						<el-form-item label="运费结算:" label-width="80px">
							<el-input placeholder="" v-model="physicalform1.carriagejs" style="width: 90%;"></el-input>
						</el-form-item>
						<el-form-item label="备注:" label-width="80px">
							<el-input placeholder="" v-model="physicalform1.ogRemark" style="width: 90%;"></el-input>
						</el-form-item>
					</el-form>
					<div slot="footer" class="dialog-footer">
						<el-button @click="rdialogFormVisible = false">取 消</el-button>
						<!-- dialogFormVisible = false -->
						<el-button type="primary" @click="addphysicalForm1('physicalform1')">确定</el-button>
					</div>
				</el-dialog>
				</div>
		</div>
		<script type="text/javascript">
			var datenew = new Date();
			var tables = ${
				outgoodit
			};
			var validateogPhysicalid =(rule, value, callback) => {
				var myreg = /^\+?[1-9][0-9]*$/;
				if (!myreg.test(value)) {
					callback(new Error('请输入正确的单号'));
				} else {
					callback();
				}
			};
			
			var validateogcarriagemoney =(rule, value, callback) => {
				var myreg = /^(([1-9][0-9]*)|(([0]\.\d{1,2}|[1-9][0-9]*\.\d{1,2})))$/;
				if (!myreg.test(value)) {
					callback(new Error('请输入正确的金额'));
				} else {
					callback();
				}
			};
			var max = new Vue({
				el: "#max",
				data: {
					repform: [],
					activeNames: [],
					boodate: false,
					oid: '${outgood.oId}',
					ogId: '${outgood.ogId}',
					uidloading: false,
					dialogAddressVisible:false,
					dialogPhysicalVisible: false,
					dialogPhysicalVisible1:false,
					osignloading1: false,
					tableData: tables,
					restaurants: [],
					uitemv: [],
					uitemvs: [],
					uosign1: [],
					uosigns1: [],
					contactes:[],
					rules: {
						ogPhysicalid: [{
							validator: validateogPhysicalid,
							trigger: 'blur'
						}],
						carriagemoney: [{
							validator: validateogcarriagemoney,
							trigger: 'blur'
						}]
					},
					Addressform:{
						uid:'',
						ogid: '${outgood.ogId}',
						postcode:'${outgood.ogPostcode}',
						contaddress:'${outgood.ogAddress}',
						oconsignee:'${outgood.shoumen}',
						conphone:'${outgood.ogPhone}',
						osign1:'',
					},
					physicalform: {
						oId: '${outgood.oId}',
						ogId: '${outgood.ogId}',
						ogRemark: '',
						ogPhysical: '',
						ogPhysicalid: '',
						carriagemoney: '',
						carriagejs: '',
					},
					physicalform1: {
						oId: '${outgood.oId}',
						ogId: '${outgood.ogId}',
						ogRemark: '',
						ogPhysical: '',
						ogPhysicalid: '',
						carriagemoney: '',
						carriagejs: '',
					},
					date1: datenew.getFullYear() + "-" + (datenew.getMonth() + 1) + "-" + datenew.getDate(),
				},
				methods: {
					/* 计算合计 */
					getSummaries(param) {
						const {
							columns,
							data
						} = param;
						const sums = [];
						columns.forEach((column, index) => {
							if (index === 0) {
								sums[index] = '总计';
								return;
							}
							const values = data.map(item => Number(item[column.property]));

							if (!values.every(value => isNaN(value))) {
								sums[index] = values.reduce((prev, curr) => {
									const value = Number(index);

									if (!isNaN(value) && index != 3) {
										return prev + curr;
									} else {
										return '';
									}

								}, 0);
								if (index == 4 || index == 6) {
									sums[index] = sums[index].toFixed(2);
								}
								if (index == 1 || index == 3 || index == 4 || index == 5 || index == 7)
									sums[index] = '---';
								if (index == 6)
									sums[index] += ' 元';
							} else {
								sums[index] = '';
							}
						});
						return sums;
					},
					updatePhysical(){
						this.physicalform1.ogRemark='${outgood.ogRemark}';
						this.physicalform1.ogPhysical='${outgood.ogPhysical}';
						this.physicalform1.ogPhysicalid='${outgood.ogPhysicalid}';
						this.physicalform1.carriagemoney='${outgood.carriagemoney}';
						this.physicalform1.carriagejs='${outgood.carriagejs}';
						this.dialogPhysicalVisible1=true;
					},
					addphysicalForm(rmform) {
						var _this = this;
						this.$refs[rmform].validate((valid) => {
							if (valid) {
								//post提交数据
								axios.post("/sales/prosale/delivergoods",
									//参数转换
									Qs.stringify(
										this.physicalform, {
											arrayFormat: 'brackets'
										})
									//	params:
									//ajax请求成功的回调函数
								).then(function(v) {
									console.log("回调成功，获取了服务器端返回的值v");
									console.log(v);
									window.location.href = '/sales/prosale/orderView?id=' + _this.oid;
								}).catch(function() {
									alert("出错了");
								});
							} else {
								console.log('error submit!!');
								return false;
							}
						});
					},
					addphysicalForm1(rmform) {
						var _this = this;
						this.$refs[rmform].validate((valid) => {
							if (valid) {
								//post提交数据
								axios.post("/sales/prosale/delivergood",
									//参数转换
									Qs.stringify(
										this.physicalform1, {
											arrayFormat: 'brackets'
										})
									//	params:
									//ajax请求成功的回调函数
								).then(function(v) {
									console.log("回调成功，获取了服务器端返回的值v");
									console.log(v);
									window.location.href = '/sales/prosale/outGoodsbill?ogid=' + _this.ogId;
								}).catch(function() {
									alert("出错了");
								});
							} else {
								console.log('error submit!!');
								return false;
							}
						});
					},
					querySearch(queryString, cb) {
						var restaurants = this.restaurants;
						var results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants;
						// 调用 callback 返回建议列表的数据
						cb(results);
					},
					createFilter(queryString) {
						return (restaurant) => {
							return (restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0);
						};
					},
					loadAll() {
						return [{"value": "顺丰速递"},
								{"value": "EMS快递"},
								{"value": "申通快递",},
								{"value": "圆通快递"},
								{"value": "天天快递"},
								{"value": "韵达快运"},
								{"value": "中通速递"},
								{"value": "汇通快运"},
								{"value": "全一快递"},
								{"value": "中铁快运"}];
					},
					handleSelect(item) {
						console.log(item);
					},
					uidremoteMethod(query) {
						var _this = this;
						if (query !== '') {
							this.uidloading = true;
							setTimeout(() => {
								this.uidloading = false;
								this.uitemv = _this.uitemvs.filter(item => {
									return item.label.toLowerCase()
										.indexOf(query.toLowerCase()) > -1;
								});
							}, 200);
						} else {
							this.uosign = [];
						}
					},
					uitemvto() {
						var _this = this;
						_this.uitemv = _this.uitemvs;
					},
					osignremoteMethod1(query) {
						var _this = this;
						if (query !== '') {
							this.osignloading1 = true;
							setTimeout(() => {
								this.osignloading1 = false;
								this.uosign1 = _this.uosigns1.filter(item => {
									return item.label.toLowerCase()
										.indexOf(query.toLowerCase()) > -1;
								});
							}, 200);
						} else {
							this.uosign = [];
						}
					},
					updateAddress(){
						
						var _this = this;
						axios.post("/sales/prosale/updatefaaddpage",
							//参数转换
							Qs.stringify({
								'ID':'${outgood.custId}'
							}, {
								arrayFormat: 'brackets'
							})
							//ajax请求成功的回调函数
						).then(function(v) {
							console.log("回调成功，获取了服务器端返回的值v");
							console.log(v.data.contact);
							//将数据装换成界面显示
							_this.uosigns1 = v.data.contact.map(item => {
								return {
									value: item.ID,
									label: item.name
								};
							});
							_this.uosign1=_this.uosigns1
							_this.uitemvs = v.data.userAll.map(item => {
								return {
									value: item.ID,
									label: item.name
								};
							});
							_this.uitemv=_this.uitemvs;
							_this.contactes = v.data.contact;
							_this.Addressform.uid= ${outgood.consigner};
							_this.dialogAddressVisible=true;
						
						
						})/* .catch(function() {
							alert("信息出错了");
						}); */
					},
					aa: function() {
						var _this = this;
					
						_this.contactes.map(item => {
							if (_this.Addressform.osign1 == item.ID) {
								_this.Addressform.oconsignee = item.name;
								_this.Addressform.conphone = item.phone;
								_this.Addressform.contaddress = item.address;
								_this.Addressform.postcode = item.code;
							}
						});
					},
					submitFormUp(form) {
						//验证方法
						this.$refs[form].validate((valid) => {
							var _this=this;
							if (valid) {
								//post提交数据
								axios.post("/sales/prosale/updateAddress",
									//参数转换
									Qs.stringify(
										this.Addressform, {
											arrayFormat: 'brackets'
										})
									//	params:
									//ajax请求成功的回调函数
								).then(function(v) {
									console.log("回调成功，获取了服务器端返回的值v");
									console.log(v);
									window.location.href = '/sales/prosale/outGoodsbill?ogid=' + _this.ogId;
								}).catch(function() {
									alert("出错了");
								});
							} else {
								console.log('error submit!!');
								return false;
							}
						});
					},

				},
				mounted: function() {
					if ("${outgood.deliverydate}" == "") {
						this.boodate = true;
						
					}
					this.restaurants = this.loadAll();
				}

			})
		</script>
	</body>
</html>
